from flask import Flask
from toutiao_backend_3.toutiao.config import Config
from toutiao_backend_3.toutiao.model.db_totiao import db

app = Flask(__name__)
def create_app():
    app = Flask(__name__)
    app.config.from_object(Config)
    with app.app_context():
        db.init_app(app)
        db.create_all()
    return app

app = create_app()

if __name__ == '__main__':
    app.run()
